#ifndef _GRAPHICS_ENGINE_H
#define _GRAPHICS_ENGINE_H

#include <QMainWindow>
#include "GlWindow.h"
#include "InfoWindow.h"
#include "PreferencesDialog.h"

class GameEngine;
class Player;
class QAction;
class QLabel;
class QWidget;

#include <iostream>
#include <cstring>
using namespace std;

class GraphicsEngine : public QMainWindow
{
    Q_OBJECT

    public:
        GraphicsEngine();
        ~GraphicsEngine();
        void initialization( GameEngine * );

	protected:
		void closeEvent(QCloseEvent *event);

    private slots:
        void newGame();
        bool saveGame();
        bool loadGame();
        void preferences();
		void undoMove();
		void redoMove();
        void displayWinner(Player*);
		void updateSettingRegularMoves();
		void updateSettingLastMove();
		void updateSettingAnimation();
		void setDisplayUndoMoveAction(bool);
		void setDisplayRedoMoveAction(bool);
		
    private:
        void createActions();
        void createMenus();
        void createToolBars();
		void createStatusBar();
		
        void connecting( GameEngine * );

		void writeSettings();
		void readSettings();

		QWidget *centralWindow;
        GlWindow *scene;
		InfoWindow *infos;

		QLabel *statusBarLabel;

        QMenu *fileMenu;
        QMenu *viewMenu;
        
        QMenu *toolsMenu;
        QMenu *helpMenu;

        QToolBar *fileToolBar;
		QToolBar *toolsToolBar;

//------- Action du Menu "File" ---------------
        QAction *newAction;
        QAction *saveAction;
        QAction *loadAction;
        QAction *exitAction;

//------- Action du Menu "View" ---------------
		QAction *regularMovesAction;
		QAction *lastMoveAction;
		QAction *animationAction;
		

//------- Action du Menu "Tools" ---------------
        QAction *undoMoveAction;
        QAction *redoMoveAction;
   		QAction *preferencesAction;
/*		QAction *breakAction;
		QAction *optionsAction;

//------- Action du Menu "Help" ---------------
        QAction *aboutAction;
        QAction *helpAction;
*/      
        
	signals:
		void startNewGame();
		void undoMoveAsked();
		void redoMoveAsked();
//		void settingsPlayersChanged(QString,TypePlayer,QString,TypePlayer);

};

#endif
